@import url('./animate.css');
@import url('./loading.css');

@text-color: #000;
@border-radius: 5px;
@small-width: 768px;
@middle-width: 992px;
@large-width: 1200px;

html, body {
  font-size: 16px;
  margin: 0 auto;
  background-color: #f5f6f7;
  color: #4f4f4f;
}

a {
  color: @text-color;
  text-decoration: none;
  &:hover {
    text-decoration: underline;
  }
  &:visited {
    text-decoration: underline;
    color: @text-color;
  }
  &:active {
    text-decoration: none;
    color: @text-color;
  }
}

input, textarea, select {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
  border: 2px solid @text-color;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: @text-color;
  width: 100%;
  border-radius: @border-radius;
  display: block;
  resize: none;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
       -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
          transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  &:focus {
    outline-color: transparent;
  }
}

button {
  border: 2px solid @text-color;
  border-radius: @border-radius;
  padding: 10px 15px;
  background-color: #fff;
  &:focus {
    outline-color: transparent;
  }
}

img {
  max-width: 100%;
}

table {
  border-spacing: 10px;
  .action {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
.commentBtn {
  margin-top: 5px;
}
.container {
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}
@media (min-width: @small-width) {
  .container {
    width: 750px;
  }
  .commentBtn {
    display: block;
  }
}
@media (min-width: @middle-width) {
  .container {
    width: 970px;
  }
  .commentBtn {
    display: block;
  }
}
@media (min-width: @large-width) {
  .container {
    width: 1170px;
  }
  .commentBtn {
    display: none;
  }
}

.header {
  height: 50px;
  width: 100%;
  line-height: 50px;
  border-bottom: 2px solid @text-color;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  .logo {
    font-size: 1.4em;
  }
  .right {
    a, span {
      margin-left: 10px;
    }
    span {
      cursor: pointer;
    }
  }
}

.login-register {
  width: 100%;
  th {
    width: 15%;
    text-align: left;
  }
}

.user-info {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .info {
    flex: 0 0 200px;
    margin-right: 20px;
    .avatar-lg {
      border-radius: @border-radius;
      width: 200px;
      height: 200px;
    }
    .profile {
      list-style: none;
      padding: 0;
      line-height: 1.7em;
      .username {
        font-size: 22px;
        font-weight: 500;
      }
      .bio {
        font-size: 14px;
        line-height: 1.5em;
        font-style: italic;
      }
      @media (max-width: @middle-width) {
        .bio {
          overflow: hidden;
          text-overflow: ellipsis;
          line-clamp: 3;
          white-space: nowrap;
        }
      }
    }
  }
  .topics-comments {
    flex: 1;
    .topics {
      margin-bottom: 20px;
    }
    .topics, .comments {
      border: 2px solid @text-color;
      border-radius: @border-radius;
      table {
        border-spacing: 0;
        width: 100%;
        caption {
          font-weight: 500;
          font-size: 18px;
          padding: 10px 0;
        }
        td {
          padding: 10px 15px;
          border-top: 2px solid @text-color;
        }
      }
    }
  }
  @media (max-width: @middle-width) {
    .info {
      flex: 0 0 1;
      min-width: 100%;
    }
    .topics-comments {
      flex: 1;
      width: 100%;
      margin-left: 0;
    }
  }
}
.score-list {
  table {
    border-spacing: 0;
    width: 100%;
    caption {
      font-weight: 500;
      font-size: 18px;
      padding: 10px 0;
    }
    td {
      padding: 10px 15px;
      border-top: 1px solid @text-color;
      .avatar {
        width: 24px;
        height: 24px;
        vertical-align: middle;
        border-radius: @border-radius;
      }
    }
  }
}
section {
  .form-input {
    width: 100%;
  }
  .form-content {
    width: 100%;
    height: 300px;
  }
  .user-settings {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    table {
      flex: 0 0 0.5;
      width: 50%;
      th {
        text-align: right;
        width: 15%;
      }
    }
    @media (max-width: @middle-width) {
      table {
        flex: 0 0 1;
        width: 100%;
      }
    }
  }
  @media (max-width: @small-width) {
    .create-topic {
      th {
        display: none;
      }
    }
  }
  .topic-list {
    ul {
      list-style: none;
      padding-left: 0;
      li {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        margin: 10px 0;
        padding: 10px 0 20px 0;
        border-bottom: 1px solid @text-color;
        &:last-child {
          border: 0;
        }
        .topic {
          flex: 1;
          margin-left: 10px;
        }
        .avatar {
          width: 50px;
          height: 50px;
          border-radius: @border-radius;
        }
        .title {
          font-size: 20px;
          font-weight: 500;
          margin-bottom: 5px;
          word-break: break-all;
        }
        .tab {
          background-color: @text-color;
          padding: 0 5px;
          color: #fff;
          border-radius: @border-radius;
        }
      }
    }
  }
  .topic-detail {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    border-bottom: 1px solid @text-color;
    .topic {
      flex: 1;
      .title {
        margin-bottom: 10px;
        font-size: 24px;
        word-break: break-all;
      }
      .topic-info {
        padding: 0 0 10px 5px;
        .tab {
          font-size: 14px;
          background-color: @text-color;
          padding: 0 5px;
          color: #fff;
          border-radius: @border-radius;
        }
        .topic-actions {
          cursor: pointer;
        }
      }
    }
    .avatar {
      width: 60px;
      height: 60px;
      border-radius: @border-radius;
    }
  }
  .topic-content {
    line-height: 1.7em;
    border-bottom: 2px solid @text-color;
    word-break: break-all;
  }
  .comments {
    margin-top: 20px;
  }
  .comment-info {
    cursor: pointer;
    .avatar {
      width: 24px;
      height: 24px;
      border-radius: @border-radius;
      vertical-align: middle;
      margin-right: 10px;
    }
  }
  .comment-content {
    margin-left: 34px;
    word-break: break-all;
  }
}

.load-more {
  font-weight: 500;
  cursor: pointer;
  height: 35px;
  line-height: 35px;
  border: 2px solid @text-color;
  text-align: center;
  border-radius: @border-radius;
  &:hover {
    background-color: @text-color;
    color: #fff;
  }
}

.top-good {
  font-size: 24px;
  background-color: @text-color;
  color: #fff;
  padding: 0 5px;
  border-radius: @border-radius;
  margin-right: 5px;
}

.tabs {
  display: flex;
  text-align: center;
  align-items: center;
  border-bottom: 1px solid @text-color;
  &>div {
    cursor: pointer;
    padding: 5px 0;
    flex: 1;
  }
  &>div.active {
    background-color: @text-color;
    color: #fff;
  }
}

.footer {
  margin-top: 20px;
  border-top: 2px solid @text-color;
  padding: 10px 0;
}

.toast {
  z-index: 100;
  position: fixed;
  top: 40px;
  right: 50px;
  width: 300px;
  min-height: 40px;
  padding: 10px;
  border: 2px solid @text-color;
  border-radius: @border-radius;
  background-color: #f5f6f7;
}
